package com.hhk.transaction.service.impl;

import com.hhk.transaction.mapper.StudentMapper;
import com.hhk.transaction.model.Student;
import com.hhk.transaction.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class StudentServiceImpl implements StudentService {
//    这里是实现接口的方法，以提供给控制层使用
    @Autowired//注入dao以调用操作数据库的方法
    private StudentMapper studentMapper;

    @Transactional//添加事务
    @Override
    public int queryStudentById(Student student){
        int i=studentMapper.updateByPrimaryKeySelective(student);
        int a=10/0;
        return i;
    }

}
